import type { ResponseData } from './request';

export interface UserInterface {
  user: UserInfoInterface;
  setting: UserSettingInterface;
  clientIp: string;
}

export interface UserInfoInterface {
  userId: string;
  idrNo: string;
  workNo: string;
  fullName: string;
  category: string;
  categoryDesc: string;
  workDept: string;
  workDeptName: string;
  jobStatus: string;
  jobStatusName: string;
  workPost: string;
  workPostName: string;
  workProfessional: string;
  workProfessionalName: string;
  duty: string;
  dutyName: string;
  mplFlag: null;
  mobile: string;
  idCard: string;
  officePhone: null;
  email: null;
  pinyinCode: string;
  wubiCode: string;
  activeStatus: string;
  activeStatusDesc: string;
  lockStatus: string;
  lockStatusDesc: string;
  effectTime: null;
  expiresTime: null;
  userType: null;
  hospitalCode: string;
  npCode: string;
  param: null;
  effectTimeStr: null;
  expiresTimeStr: null;
  workDeptList: null;
  dutyList: null;
  maintainSpecialistInfo: null;
  orgCode: null;
}

export interface UserSettingInterface {
  userId: string;
  themeStyle: string;
  fontSize: string;
  bizCard: string;
}

//
export const userApi = (): Promise<ResponseData<UserInterface>> =>
  request<ResponseData<UserInterface>, null>('/apm-bff-server/apm/user', 'get');
